
Last chance! 50% off unlimited learning
Sale ends in
graph.adjlist(adjlist, directed = TRUE, duplicate = TRUE)
TRUE
then for an undirected {A,B}
edge
graph.adjlist
expects A
included in the neigh The idea is that you convert your graph to an adjacency list by
get.adjlist
, do your modifications to the graphs and
finally create again an igraph graph by calling graph.adjlist
.
get.edgelist
## Directed
g <- graph.ring(10, dir=TRUE)
al <- get.adjlist(g, mode="out")
g2 <- graph.adjlist(al)
graph.isomorphic(g, g2)
## Undirected
g <- graph.ring(10)
al <- get.adjlist(g)
g2 <- graph.adjlist(al, dir=FALSE)
graph.isomorphic(g, g2)
ecount(g2)
g3 <- graph.adjlist(al, dir=FALSE, duplicate=FALSE)
ecount(g3)
is.multiple(g3)
Run the code above in your browser using DataLab